<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/admintemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListStudentCourseTitle}"></h:outputText>
        </ui:define>
        <ui:define name="leftmenu">
            <h:form>
                <ul class="section menu">
                    <li><a class="menuitem">#{bundle.ControlPanelMenu}</a>
                        <ul class="submenu">
                            <li><h:commandLink action="#{studentCourseController.prepareCreate}" value="#{bundle.ListStudentCourseCreateLink}"/> </li>
                            <li><h:commandLink action="#{studentCourseController.SearchByCourseName()}" value="#{bundle.CreateStudentCourseShowAllLink}" immediate="true"/> </li>
                        </ul>
                    </li>
                </ul>
            </h:form>
        </ui:define>
        <ui:define name="content">
            <h2>#{bundle.ListStudentCourseTitle}</h2>
            <div class="block">
                <h:form>
                    
                    <h:panelGroup rendered="#{studentCourseController.items.rowCount > 0}">
                        <div class="tablePaging">
                            <h:commandButton value="Search CourseName" action="#{studentCourseController.SearchByCourseName()}"></h:commandButton ><h:inputText value="#{studentCourseController.nameSearch}"/>
                            <h:outputText value="Showing #{studentCourseController.pagination.pageFirstItem + 1} to #{studentCourseController.pagination.pageLastItem + 1} of #{studentCourseController.pagination.itemsCount} entries"/>&nbsp;
                            <h:commandLink action="#{studentCourseController.previous}" class="btn-icon btn-teal btn-arrow-left btn-small" rendered="#{studentCourseController.pagination.hasPreviousPage}">
                                <span></span>
                                #{bundle.Previous} #{studentCourseController.pagination.pageSize}
                            </h:commandLink>&nbsp;
                            <h:commandLink action="#{studentCourseController.next}" class="btn-icon btn-teal btn-arrow-right btn-small" rendered="#{studentCourseController.pagination.hasNextPage}">
                                <span></span>
                                #{bundle.Next} #{studentCourseController.pagination.pageSize}
                            </h:commandLink>&nbsp;
                        </div>
                        <h:dataTable value="#{studentCourseController.items}" class="CSSTableGenerator" var="item" border="0" cellpadding="2" cellspacing="0" rules="all">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListStudentCourseTitle_mark}"/>
                                </f:facet>
                                <ui:fragment rendered="#{item.mark>0}">
                                   <font color="blue">#{item.mark}</font>
                                </ui:fragment>
                                <ui:fragment rendered="#{item.mark==0}">
                                    <font color="blue">(Not Mark)</font>
                                </ui:fragment>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListStudentCourseTitle_fileUpload}"/>
                                </f:facet>
                                <h:outputText value="#{item.fileUpload}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListStudentCourseTitle_students}"/>
                                </f:facet>
                                <h:outputText value="#{item.students.userName}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListStudentCourseTitle_course}"/>
                                </f:facet>
                                <h:outputText value="#{item.course.courseName}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Options"/>
                                </f:facet>
                                <h:commandLink action="#{studentCourseController.prepareView}" value="#{bundle.ListStudentCourseViewLink}"/>
                                <h:outputText value=" "/>
                                <h:commandLink action="#{studentCourseController.prepareEdit}" value="#{bundle.ListStudentCourseEditLink}"/>
                                <h:outputText value=" "/>
                                <h:commandLink action="#{studentCourseController.destroy}" value="#{bundle.ListStudentCourseDestroyLink}"/>
                            </h:column>
                        </h:dataTable>
                    </h:panelGroup>
                </h:form>
            </div>
        </ui:define>
    </ui:composition>

</html>
